home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / PictUtil.h < prev    next >
Text File  |  1991-05-01  |  5KB  |  171 lines

  1. /*
  2.     File:        PictUtil.h
  3.  
  4.     Contains:    C-Style headers for the picture utilities package
  5.  
  6.     Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #ifndef __PICTUTIL__
  12. #define __PICTUTIL__
  13.  
  14. #ifndef __TYPES__
  15. #include <Types.h>
  16. #endif
  17.  
  18. #ifndef __GEOMETRY__
  19. #include <Geometry.h>
  20. #endif
  21.  
  22. #ifndef __PALETTES__
  23. #include <Palettes.h>
  24. #endif
  25.  
  26. /*----------------------------------------------------------------------------------------------------------*/
  27.  
  28. /* verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls */
  29.  
  30. #define returnColorTable            ( (short) 0x0001 )
  31. #define    returnPalette                ( (short) 0x0002 )
  32. #define    recordComments                ( (short) 0x0004 )
  33. #define    recordFontInfo                ( (short) 0x0008 )
  34. #define    suppressBlackAndWhite        ( (short) 0x0010 )
  35.  
  36.  
  37. /* color pick methods */
  38.  
  39. #define systemMethod                0
  40. #define    popularMethod                1
  41. #define medianMethod                2
  42.  
  43.  
  44. /* color bank types */
  45.  
  46. #define ColorBankIsCustom            -1
  47. #define ColorBankIsExactAnd555        0
  48. #define ColorBankIs555                1
  49.  
  50.  
  51. /*----------------------------------------------------------------------------------------------------------*/
  52.  
  53. /*
  54. |    Data Structures
  55. */
  56.  
  57. struct CommentSpec {
  58.  
  59.     short            count;                        /* number of occurrances of this comment ID */
  60.     short            ID;                            /* ID for the comment in the picture */
  61.  
  62. };
  63. typedef    struct CommentSpec CommentSpec;
  64. typedef    CommentSpec *CommentSpecPtr, **CommentSpecHandle;
  65.  
  66.  
  67. struct FontSpec {
  68.  
  69.     short            pictFontID;                    /* ID of the font in the picture */
  70.     short            sysFontID;                    /* ID of the same font in the current system file */
  71.     long            size[4];                    /* bit array of all the sizes found (1..127) (bit 0 means > 127) */
  72.     short            style;                        /* combined style of all occurrances of the font */
  73.     long            nameOffset;                    /* offset into the fontNamesHdl handle for the font’s name */
  74.  
  75. };
  76. typedef    struct FontSpec FontSpec;
  77. typedef    FontSpec *FontSpecPtr, **FontSpecHandle;
  78.  
  79.  
  80.  
  81. struct  PictInfo {
  82.  
  83.     short                version;                /* this is always zero, for now */
  84.     long                uniqueColors;            /* the number of actual colors in the picture(s)/pixmap(s) */
  85.     PaletteHandle        thePalette;                /* handle to the palette information */
  86.     CTabHandle            theColorTable;            /* handle to the color table */
  87.     Fixed                hRes;                    /* maximum horizontal resolution for all the pixmaps */
  88.     Fixed                vRes;                    /* maximum vertical resolution for all the pixmaps */
  89.     short                depth;                    /* maximum depth for all the pixmaps (in the picture) */
  90.     Rect                sourceRect;                /* the picture frame rectangle (this contains the entire picture) */
  91.     long                textCount;                /* total number of text strings in the picture */
  92.     long                lineCount;                /* total number of lines in the picture */
  93.     long                rectCount;                /* total number of rectangles in the picture */
  94.     long                rRectCount;                /* total number of round rectangles in the picture */
  95.     long                ovalCount;                /* total number of ovals in the picture */
  96.     long                arcCount;                /* total number of arcs in the picture */
  97.     long                polyCount;                /* total number of polygons in the picture */
  98.     long                regionCount;            /* total number of regions in the picture */
  99.     long                bitMapCount;            /* total number of bitmaps in the picture */
  100.     long                pixMapCount;            /* total number of pixmaps in the picture */
  101.     long                commentCount;            /* total number of comments in the picture */
  102.     long                uniqueComments;            /* the number of unique comments in the picture */
  103.     CommentSpecHandle    commentHandle;            /* handle to all the comment information */
  104.     long                uniqueFonts;            /* the number of unique fonts in the picture */
  105.     FontSpecHandle        fontHandle;                /* handle to the FontSpec information */
  106.     Handle                fontNamesHandle;        /* handle to the font names */
  107.     long                reserved1;
  108.     long                reserved2;
  109.  
  110. };
  111. typedef    PictInfo *PictInfoPtr,**PictInfoHandle;
  112.  
  113. typedef    long PictInfoID;
  114.  
  115.  
  116. #ifdef __cplusplus
  117. extern "C" {
  118. #endif
  119.  
  120. pascal OSErr GetPictInfo        (    PicHandle        thePictHandle, 
  121.                                     PictInfo&        thePictInfo,
  122.                                     short            verb,
  123.                                     short            colorsRequested,
  124.                                     short            colorPickMethod,
  125.                                     short            version
  126.                                 ) = { 0x303C, 0x0800, 0xA831 };
  127.  
  128.  
  129. pascal OSErr GetPixMapInfo        (    PixMapHandle    thePixMapHandle, 
  130.                                     PictInfo&        thePictInfo,
  131.                                     short            verb,
  132.                                     short            colorsRequested,
  133.                                     short            colorPickMethod,
  134.                                     short            version
  135.                                 ) = { 0x303C, 0x0801, 0xA831 };
  136.  
  137.  
  138. pascal OSErr NewPictInfo        (    PictInfoID&        thePictInfoID,
  139.                                     short            verb,
  140.                                     short            colorsRequested,
  141.                                     short            colorPickMethod,
  142.                                     short            version
  143.                                 ) = { 0x303C, 0x0602, 0xA831 };
  144.  
  145.  
  146. pascal OSErr RecordPictInfo        (    PictInfoID        thePictInfoID,
  147.                                     PicHandle        thePictHandle
  148.                                 ) = { 0x303C, 0x0403, 0xA831 };
  149.  
  150.  
  151. pascal OSErr RecordPixMapInfo    (    PictInfoID        thePictInfoID,
  152.                                     PixMapHandle    thePixMapHandle
  153.                                 ) = { 0x303C, 0x0404, 0xA831 };
  154.  
  155.  
  156. pascal OSErr RetrievePictInfo    (    PictInfoID        thePictInfoID,
  157.                                     PictInfo&        thePictInfo,
  158.                                     short            colorsRequested
  159.                                 ) = { 0x303C, 0x0505, 0xA831 };
  160.  
  161.  
  162. pascal OSErr DisposPictInfo        (    PictInfoID        thePictInfoID
  163.                                 ) = { 0x303C, 0x0206, 0xA831 };
  164.  
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170. #endif
  171.